#include "serial.h"
// 串口任务
void serialTask(void *parameter)
{
  while (1)
  {
    if (!readLLMDataStatus)
    {
      // 把大模型数据转发给stm32
      String jsonStr = "@" + LLMData + "\r\n";
      Serial1.write(jsonStr.c_str()); 
      readLLMDataStatus = 1; 
    }
    // 读取stm32数据
    if (Serial1.available())
    {
      String data = Serial1.readString(); // 读取串口数据
      Serial.print("Received from STM32: ");
      Serial.println(data); // 打印接收到的数据
    }

    vTaskDelay(pdMS_TO_TICKS(20));
  }
}